package com.nts.jvm.op;


import java.util.HashMap;
import java.util.Map;

public class OpFactory {

    public static final Map<Integer, Instruction> instionList = new HashMap<>();

    static {
        instionList.put(0x00, new Nop());
        instionList.put(0x01, new Aconst_null());
        instionList.put(0x02, new Iconst_m1());
        instionList.put(0x03, new Iconst_0());
        instionList.put(0x04, new Iconst_1());
        instionList.put(0x05, new Iconst_2());
        instionList.put(0x06, new Iconst_3());
        instionList.put(0x07, new Iconst_4());
        instionList.put(0x08, new Iconst_5());
        instionList.put(0x09, new Lconst_0());
        instionList.put(0x0a, new Lconst_1());
        instionList.put(0x0b, new Fconst_0());
        instionList.put(0x0c, new Fconst_1());
        instionList.put(0x0d, new Fconst_2());
        instionList.put(0x0e, new Dconst_0());
        instionList.put(0x0f, new Dconst_1());
        instionList.put(0x10, new Bipush());
        instionList.put(0x11, new Sipush());
        instionList.put(0x12, new Ldc());
        instionList.put(0x13, new Ldc_w());
        instionList.put(0x14, new Ldc2_w());
        instionList.put(0x15, new Iload());
        instionList.put(0x16, new Lload());
        instionList.put(0x17, new Fload());
        instionList.put(0x18, new Dload());
        instionList.put(0x19, new Aload());
        instionList.put(0x1a, new Iload_0());
        instionList.put(0x1b, new Iload_1());
        instionList.put(0x1c, new Iload_2());
        instionList.put(0x1d, new Iload_3());
        instionList.put(0x1e, new Lload_0());
        instionList.put(0x1f, new Lload_1());
        instionList.put(0x20, new Lload_2());
        instionList.put(0x21, new Lload_3());
        instionList.put(0x22, new Fload_0());
        instionList.put(0x23, new Fload_1());
        instionList.put(0x24, new Fload_2());
        instionList.put(0x25, new Fload_3());
        instionList.put(0x26, new Dload_0());
        instionList.put(0x27, new Dload_1());
        instionList.put(0x28, new Dload_2());
        instionList.put(0x29, new Dload_3());
        instionList.put(0x2a, new Aload_0());
        instionList.put(0x2b, new Aload_1());
        instionList.put(0x2c, new Aload_2());
        instionList.put(0x2d, new Aload_3());
        instionList.put(0x2e, new Iaload());
        instionList.put(0x2f, new Laload());
        instionList.put(0x30, new Faload());
        instionList.put(0x31, new Daload());
        instionList.put(0x32, new Aaload());
        instionList.put(0x33, new Baload());
        instionList.put(0x34, new Caload());
        instionList.put(0x35, new Saload());
        instionList.put(0x36, new Istore());
        instionList.put(0x37, new Lstore());
        instionList.put(0x38, new Fstore());
        instionList.put(0x39, new Dstore());
        instionList.put(0x3a, new Astore());
        instionList.put(0x3b, new Istore_0());
        instionList.put(0x3c, new Istore_1());
        instionList.put(0x3d, new Istore_2());
        instionList.put(0x3e, new Istore_3());
        instionList.put(0x3f, new Lstore_0());
        instionList.put(0x40, new Lstore_1());
        instionList.put(0x41, new Lstore_2());
        instionList.put(0x42, new Lstore_3());
        instionList.put(0x43, new Fstore_0());
        instionList.put(0x44, new Fstore_1());
        instionList.put(0x45, new Fstore_2());
        instionList.put(0x46, new Fstore_3());
        instionList.put(0x47, new Dstore_0());
        instionList.put(0x48, new Dstore_1());
        instionList.put(0x49, new Dstore_2());
        instionList.put(0x4a, new Dstore_3());
        instionList.put(0x4b, new Astore_0());
        instionList.put(0x4c, new Astore_1());
        instionList.put(0x4d, new Astore_2());
        instionList.put(0x4e, new Astore_3());
        instionList.put(0x4f, new Iastore());
        instionList.put(0x50, new Lastore());
        instionList.put(0x51, new Fastore());
        instionList.put(0x52, new Dastore());
        instionList.put(0x53, new Aastore());
        instionList.put(0x54, new Bastore());
        instionList.put(0x55, new Castore());
        instionList.put(0x56, new Sastore());
        instionList.put(0x57, new Pop());
        instionList.put(0x58, new Pop2());
        instionList.put(0x59, new Dup());
        instionList.put(0x5a, new Dup_x1());
        instionList.put(0x5b, new Dup_x2());
        instionList.put(0x5c, new Dup2());
        instionList.put(0x5d, new Dup2_x1());
        instionList.put(0x5e, new Dup2_x2());
        instionList.put(0x5f, new Swap());
        instionList.put(0x60, new Iadd());
        instionList.put(0x61, new Ladd());
        instionList.put(0x62, new Fadd());
        instionList.put(0x63, new Dadd());
        instionList.put(0x64, new Isub());
        instionList.put(0x65, new Lsub());
        instionList.put(0x66, new Fsub());
        instionList.put(0x67, new Dsub());
        instionList.put(0x68, new Imul());
        instionList.put(0x69, new Lmul());
        instionList.put(0x6a, new Fmul());
        instionList.put(0x6b, new Dmul());
        instionList.put(0x6c, new Idiv());
        instionList.put(0x6d, new Ldiv());
        instionList.put(0x6e, new Fdiv());
        instionList.put(0x6f, new Ddiv());
        instionList.put(0x70, new Irem());
        instionList.put(0x71, new Lrem());
        instionList.put(0x72, new Frem());
        instionList.put(0x73, new Drem());
        instionList.put(0x74, new Ineg());
        instionList.put(0x75, new Lneg());
        instionList.put(0x76, new Fneg());
        instionList.put(0x77, new Dneg());
        instionList.put(0x78, new Ishl());
        instionList.put(0x79, new Lshl());
        instionList.put(0x7a, new Ishr());
        instionList.put(0x7b, new Lshr());
        instionList.put(0x7c, new Iushr());
        instionList.put(0x7d, new Lushr());
        instionList.put(0x7e, new Iand());
        instionList.put(0x7f, new Land());
        instionList.put(0x80, new Ior());
        instionList.put(0x81, new Lor());
        instionList.put(0x82, new Ixor());
        instionList.put(0x83, new Lxor());
        instionList.put(0x84, new Iinc());
        instionList.put(0x85, new I2l());
        instionList.put(0x86, new I2f());
        instionList.put(0x87, new I2d());
        instionList.put(0x88, new L2i());
        instionList.put(0x89, new L2f());
        instionList.put(0x8a, new L2d());
        instionList.put(0x8b, new F2i());
        instionList.put(0x8c, new F2l());
        instionList.put(0x8d, new F2d());
        instionList.put(0x8e, new D2i());
        instionList.put(0x8f, new D2l());
        instionList.put(0x90, new D2f());
        instionList.put(0x91, new I2b());
        instionList.put(0x92, new I2c());
        instionList.put(0x93, new I2s());
        instionList.put(0x94, new Lcmp());
        instionList.put(0x95, new Fcmpl());
        instionList.put(0x96, new Fcmpg());
        instionList.put(0x97, new Dcmpl());
        instionList.put(0x98, new Dcmpg());
        instionList.put(0x99, new Ifeq());
        instionList.put(0x9a, new Ifne());
        instionList.put(0x9b, new Iflt());
        instionList.put(0x9c, new Ifge());
        instionList.put(0x9d, new Ifgt());
        instionList.put(0x9e, new Ifle());
        instionList.put(0x9f, new If_icmpeq());
        instionList.put(0xa0, new If_icmpne());
        instionList.put(0xa1, new If_icmplt());
        instionList.put(0xa2, new If_icmpge());
        instionList.put(0xa3, new If_icmpgt());
        instionList.put(0xa4, new If_icmple());
        instionList.put(0xa5, new If_acmpeq());
        instionList.put(0xa6, new If_acmpne());
        instionList.put(0xa7, new Goto());
        instionList.put(0xa8, new Jsr());
        instionList.put(0xa9, new Ret());
        instionList.put(0xaa, new Tableswitch());
        instionList.put(0xab, new Lookupswitch());
        instionList.put(0xac, new Ireturn());
        instionList.put(0xad, new Lreturn());
        instionList.put(0xae, new Freturn());
        instionList.put(0xaf, new Dreturn());
        instionList.put(0xb0, new Areturn());
        instionList.put(0xb1, new Return());
        instionList.put(0xb2, new Getstatic());
        instionList.put(0xb3, new Putstatic());
        instionList.put(0xb4, new Getfield());
        instionList.put(0xb5, new Putfield());
        instionList.put(0xb6, new Invokevirtual());
        instionList.put(0xb7, new Invokespecial());
        instionList.put(0xb8, new Invokestatic());
        instionList.put(0xb9, new Invokeinterface());
        instionList.put(0xba, new Invokedynamic());
        instionList.put(0xbb, new New());
        instionList.put(0xbc, new Newarray());
        instionList.put(0xbd, new Anewarray());
        instionList.put(0xbe, new Arraylength());
        instionList.put(0xbf, new Athrow());
        instionList.put(0xc0, new Checkcast());
        instionList.put(0xc1, new Instanceof());
        instionList.put(0xc2, new Monitorenter());
        instionList.put(0xc3, new Monitorexit());
        instionList.put(0xc4, new Wide());
        instionList.put(0xc5, new Multianewarray());
        instionList.put(0xc6, new Ifnull());
        instionList.put(0xc7, new Ifnonnull());
        instionList.put(0xc8, new Goto_w());
        instionList.put(0xc9, new Jsr_w());
        instionList.put(0xca, new Breakpoint());
        instionList.put(0xfe, new Impdep1());
        instionList.put(0xff, new Impdep1());

    }


}
